home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / tip / part-lab.tip < prev    next >
Text File  |  1993-09-15  |  2KB  |  89 lines

  1. % This macro source file is from the four volume series
  2. % "TeX in Practice" by Stephan von Bechtolsheim, published
  3. % 1993 by Springer-Verlag, New York.
  4. % Copyright 1993 Stephan von Bechtolsheim.
  5. % No warranty or liability is assumed.
  6. % This macro may be copied freely if no fees other than
  7. % media cost or shipping charges are charged and as long
  8. % as this copyright and the following source code itself
  9. % is not changed. Please see the series for further information.
  10. %
  11. % Version: 1.0
  12. % Date: May 1, 1993
  13. %
  14. %
  15. % This source code is documented in 30.8.7, p. III-575.
  16. % Original source in file "pp1.TEX", starting line 2185.
  17. \wlog{L: "part-lab.tip" ["pp1.TEX," l. 2185, p. III-575]}%
  18. % This file DOES NOT belong to format "texip."
  19. \catcode`\@ = 11
  20. \newif\if@LabelNow
  21. \def\@Label #1#2#3{% 
  22.     \ifnum #3 = 0
  23.         \@LabelNowtrue
  24.     \else
  25.         \ifvmode
  26.             \ifinner
  27.                 \@LabelNowtrue
  28.             \else
  29.                 \@LabelNowfalse
  30.             \fi
  31.         \else
  32.             \@LabelNowtrue
  33.         \fi
  34.     \fi
  35.     \bgroup
  36.         \let\RefCounterTwo = \relax
  37.         \xdef\@LabelTempA{%
  38.             \write\@PartAuxStream{% 
  39.                 \string\@NewLabel{#1}{#2}{\RefCounterTwo{PageNo}}}%
  40.         }%
  41.     \egroup
  42.     \if@LabelNow
  43.         \@LabelTempA
  44.     \else
  45.         \bgroup
  46.             \let\RefCounterTwo = \relax
  47.             \xdef\EveryParC{%
  48.                 \EveryParC
  49.                 \@LabelTempA
  50.             }%
  51.         \egroup
  52.     \fi
  53.     \ignorespaces
  54. }
  55. \def\CheckLabels{% 
  56.     \wlog{\string\CheckLabels: checking labels started.}%
  57.     \global\@LabelsOktrue
  58.     \@IgnoreAuxStuff
  59.     \let\@NewLabel = \@NewLabelCompare
  60.     \@ReadInAuxFiles
  61.     \if@LabelsOk
  62.         \wlog{** All labels are ok **}%
  63.     \else
  64.         \wlog{** LABELS CHANGED, reprocess document **}%
  65.     \fi
  66.     \wlog{\string\CheckLabels: done.}%
  67. }
  68. \def\@NewLabelCompare #1#2#3{% 
  69.     \if\@LabelIsDefined{##1}% 
  70.         \def\@CheckLabelTemp{{##2}{##3}}%
  71.         \edef\@@CheckLabelTemp{% 
  72.             \NameUse{\@LabelRefPrefix ##1}% 
  73.         }% 
  74.         \ifx\@CheckLabelTemp\@@CheckLabelTemp
  75.             \let\@CheckLabelsNext = \relax
  76.         \else
  77.             \let\@CheckLabelsNext = \@StopCheckingLabels
  78.         \fi
  79.     \else
  80.         \let\@CheckLabelsNext = \@StopCheckingLabels
  81.     \fi
  82.     \@CheckLabelsNext
  83. }
  84. \def\@StopCheckingLabels{% 
  85.     \global\@LabelsOkfalse
  86.     \let\@NewLabel = \GobbleThree
  87. }
  88. \catcode`\@ = 12
  89.